package com.kaifamiao.time;

import java.time.LocalDateTime;

public class LocalDateTimeMethods {

    public static void main(String[] args) {

        LocalDateTime dt = LocalDateTime.now();

        System.out.print( dt.getYear() + ",");
        System.out.print( dt.getMonth() + ",");
        System.out.print( dt.getMonthValue() + ",");
        System.out.print( dt.getDayOfMonth() + ",");

        System.out.print( dt.getDayOfWeek() + ",");

        System.out.printf( "%d:%d:%d.%d\n", dt.getHour(), dt.getMinute(), dt.getSecond() , dt.getNano() );

        LocalDateTime first = dt.plusYears( -18 );
        System.out.println( first );

        System.out.println( dt.plusMonths( 6 ) );
        System.out.println( dt.plusDays( 3 ) );

    }

}
